$(function(){
    
    $(".labaaaa").focus(function(){
        if ($(this).is('input')) {
            var orival = $(this).val();
            $(this).val("");
        }else{
            var orival = $(this).html();
            $(this).html("");
        }

        $(this).blur(function(){
            if($(this).is('input')){
                if ($(this).val() != "" && $(this).val() != orival) {
                    $(this).removeClass('delme').unbind('blur').unbind('focus');
                }else{
                    $(this).val(orival);
                }
            }else{
                if ($(this).html() != "" && $(this).html() != orival) {
                    $(this).removeClass('delme').unbind('blur').unbind('focus');
                }else if ($.browser.safari && $(this).val() != "" && $(this).val() != orival) {
                    $(this).removeClass('delme').unbind('blur').unbind('focus');
                }else{
                    $(this).html(orival);
                }
            }

        });
    });
	function setSliderHelper(){
		var portw = $('body').width();
		if(portw > 1590){
			var diff = (portw - 1590) / 2;
			$('.left-bg-repeat, .right-bg-repeat').width(Math.round(diff));
		}else{
			$('.left-bg-repeat, .right-bg-repeat').width(0);
		}
	}
	setSliderHelper();
	$(window).resize(function(){
		setSliderHelper();
	});
	
	var leftPart  = Math.round(     (   ($('body').width()-960)/2  )         );
	var tmp = 480-leftPart;
	$(".wide_slider ul").css('left', -(tmp));	
	var theCallback = function(){
		var html = $(".slider-current-active-element").next().find('.info-container').html();   //    var html = $(".slider-current-active-element").next().find('.info-container').html();  /*  avea next(). */ 
		$(".project-slider .info-container").html(html);
		
		if ( typeof window.Cufon == 'function' )
		{
			Cufon.replace('.slide_title', { textShadow: '0px 1px 0px #000000', hover: true});
			Cufon.replace('.slide_description', { textShadow: '0px 1px 0px #000000', hover: true});
		}
	};
	$(".wide_slider").configurableSlider({slideCallback : theCallback, startPos : -tmp,infiniteMode : true, speed : 400, easing : 'swing', naviContainer : '.wide_slider_navi'});
	
	
});
